import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:get/get_core/src/get_main.dart';

import 'app_bar_x.dart';

class SgyScaffold extends StatelessWidget {
  final String title;
  final Widget child;
  final void Function()? onLeadingTap;
  const SgyScaffold({super.key, required this.title, required this.child, this.onLeadingTap});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBarX(
        title: Text(title),
        centerTitle: true,
        elevation: 0,
        onLeadingTap: onLeadingTap,
      ),
      backgroundColor: Get.theme.primaryColor,
      body: Container(
          width: double.infinity,
          height: double.infinity,
          margin: const EdgeInsets.only(top: 68),
          decoration: const BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.only(
                topLeft: Radius.circular(28), topRight: Radius.circular(28)),
          ),
          child:SafeArea(
            child:  child,
        ),
      ),
    );
  }
}
